package a.f.d.a;

import a.c.e;
import a.c.k;
import a.c.q;
import a.c.x;
import a.c.y;
import a.c.z;
import a.f.c.h;
import a.f.cb;
import a.f.ld;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Comparator;
import java.util.HashMap;

public class kc
{
  public static final Object a = "y.layout.hierarchic.incremental.PartitionGrid.PARTITION_DPKEY";
  public static final Object b = "y.layout.hierarchic.incremental.PartitionGrid.PARTITION_CELL_DPKEY";
  private static final String d = "PARTITION_ORIENTATION_DPKEY";
  private z f = new z();
  private z g = new z();
  private boolean h = true;
  private boolean i = true;
  public static boolean j;
  
  public kc() {}
  
  public kc(int paramInt1, int paramInt2)
  {
    this(paramInt1, paramInt2, 0.0D, 0.0D, 0.0D, 0.0D);
  }
  
  public kc(int paramInt1, int paramInt2, double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4)
  {
    int k = 0;
    Object localObject;
    do
    {
      do
      {
        if (k >= paramInt1) {
          break;
        }
        localObject = c();
        ((pc)localObject).a(paramDouble3);
        ((pc)localObject).c(paramDouble1);
        ((pc)localObject).b(paramDouble1);
        k++;
        if (bool2) {
          break label108;
        }
        if (bool1) {
          break label106;
        }
      } while (!bool1);
    } while (bool2);
    k = 0;
    label106:
    label108:
    do
    {
      if (k >= paramInt2) {
        break;
      }
      localObject = d();
      ((n)localObject).a(paramDouble4);
      ((n)localObject).c(paramDouble2);
      ((n)localObject).b(paramDouble2);
      k++;
    } while (!bool1);
  }
  
  public boolean a()
  {
    return this.h;
  }
  
  public void a(boolean paramBoolean)
  {
    this.h = paramBoolean;
  }
  
  public boolean b()
  {
    return this.i;
  }
  
  public void b(boolean paramBoolean)
  {
    this.i = paramBoolean;
  }
  
  byte a(q paramq)
  {
    k localk = paramq.c("PARTITION_ORIENTATION_DPKEY");
    if ((d.R) || (localk != null)) {
      return ((cb)localk.get(paramq)).b();
    }
    return 0;
  }
  
  boolean c(q paramq)
  {
    k localk = paramq.c("PARTITION_ORIENTATION_DPKEY");
    if ((d.R) || (localk != null))
    {
      cb localcb = (cb)localk.get(paramq);
      return localcb.b(localcb.b());
    }
    return false;
  }
  
  public jc a(int paramInt)
  {
    ArrayList localArrayList = new ArrayList();
    localArrayList.add(d(paramInt));
    return new jc(e(), localArrayList);
  }
  
  public jc a(int paramInt1, int paramInt2, int paramInt3, int paramInt4)
  {
    boolean bool2 = d.R;
    boolean bool1 = d.Q;
    ArrayList localArrayList1 = new ArrayList();
    int k = paramInt2;
    do
    {
      while (!bool1)
      {
        if (k > paramInt4) {
          break;
        }
        if (bool1) {
          break label66;
        }
        localArrayList1.add(d(k));
        k++;
      }
    } while (bool2);
    label66:
    ArrayList localArrayList2 = new ArrayList();
    int m = paramInt1;
    do
    {
      while (!bool1)
      {
        if (m > paramInt3) {
          break;
        }
        localArrayList2.add(c(m));
        m++;
      }
    } while (bool2);
    return new jc(localArrayList2, localArrayList1);
  }
  
  public jc a(Collection paramCollection1, Collection paramCollection2)
  {
    return new jc(paramCollection1, paramCollection2);
  }
  
  public jc a(pc parampc1, n paramn1, pc parampc2, n paramn2)
  {
    return a(parampc1.a(), paramn1.a(), parampc2.a(), paramn2.a());
  }
  
  public jc b(int paramInt)
  {
    ArrayList localArrayList = new ArrayList();
    localArrayList.add(c(paramInt));
    return new jc(localArrayList, f());
  }
  
  public static kc d(q paramq)
  {
    boolean bool = d.R;
    k localk = paramq.c(a);
    if ((bool) || (localk != null))
    {
      if (bool) {
        break label43;
      }
      if (paramq.c(b) != null) {}
    }
    else
    {
      return null;
    }
    label43:
    return (kc)localk.get(paramq);
  }
  
  public pc c()
  {
    pc localpc = new pc(this.f.size(), this);
    this.f.add(localpc);
    return localpc;
  }
  
  public n d()
  {
    n localn = new n(this.g.size(), this);
    this.g.add(localn);
    return localn;
  }
  
  public static boolean e(q paramq)
  {
    boolean bool2 = d.R;
    boolean bool1 = d.Q;
    kc localkc = d(paramq);
    if (localkc != null)
    {
      h localh = new h(paramq);
      if ((bool2) || (localkc.e().size() > 1))
      {
        int k = -2;
        k localk = paramq.c(b);
        a.c.w localw = paramq.v();
        label173:
        do
        {
          if (!localw.e()) {
            break;
          }
          e locale = localw.d();
          if (bool1) {
            break label191;
          }
          if (localh != null)
          {
            if (bool2) {
              continue;
            }
            if (localh.e(locale)) {}
          }
          else
          {
            jc localjc = (jc)localk.get(locale);
            int m = (bool2) || (localjc != null) ? localjc.c().a() : -1;
            if (!bool2) {
              if (k != -2)
              {
                if (bool2) {
                  continue;
                }
                if (k == m) {
                  break label173;
                }
                localh.e();
                return true;
              }
            }
            k = m;
          }
          localw.f();
        } while (!bool1);
      }
      if (!bool2) {
        label191:
        localh.e();
      }
    }
    return false;
  }
  
  public pc c(int paramInt)
  {
    boolean bool2 = d.R;
    boolean bool1 = d.Q;
    y localy = this.f.h();
    do
    {
      if (!localy.e()) {
        break;
      }
      pc localpc = (pc)localy.j();
      if (!bool2)
      {
        if (localpc.a() == paramInt) {
          return localpc;
        }
        localy.f();
      }
    } while (!bool1);
    return null;
  }
  
  public n d(int paramInt)
  {
    boolean bool2 = d.R;
    boolean bool1 = d.Q;
    y localy = this.g.h();
    do
    {
      if (!localy.e()) {
        break;
      }
      n localn = (n)localy.j();
      if (!bool2)
      {
        if (localn.a() == paramInt) {
          return localn;
        }
        localy.f();
      }
    } while (!bool1);
    return null;
  }
  
  public z e()
  {
    return this.f;
  }
  
  public z f()
  {
    return this.g;
  }
  
  public jc a(pc parampc, n paramn)
  {
    return new jc(parampc, paramn);
  }
  
  public jc a(int paramInt1, int paramInt2)
  {
    return new jc(c(paramInt1), d(paramInt2));
  }
  
  void f(q paramq)
  {
    if ((d.R) || (this.i)) {
      a(paramq, true);
    }
  }
  
  void g(q paramq)
  {
    if ((d.R) || (this.h)) {
      a(paramq, false);
    }
  }
  
  public void a(cb paramcb, cb.a_ parama_)
  {
    boolean bool3 = d.R;
    boolean bool2 = d.Q;
    boolean bool1 = paramcb.d();
    y localy = f().h();
    Object localObject;
    a.d.w localw;
    do
    {
      do
      {
        if (!localy.e()) {
          break;
        }
        localObject = (n)localy.j();
        localw = parama_.a(a((n)localObject, bool1));
        ((n)localObject).g(localw.a());
        localy.f();
        if (bool3) {
          break label112;
        }
        if (bool2) {
          break label105;
        }
      } while (!bool2);
    } while (bool3);
    localy = e().h();
    label105:
    label112:
    do
    {
      if (!localy.e()) {
        break;
      }
      localObject = (pc)localy.j();
      localw = parama_.a(a((pc)localObject, bool1));
      ((pc)localObject).g(localw.b());
      localy.f();
    } while (!bool2);
  }
  
  public void b(cb paramcb, cb.a_ parama_)
  {
    boolean bool3 = d.R;
    boolean bool2 = d.Q;
    boolean bool1 = paramcb.d();
    y localy = f().h();
    Object localObject;
    a.d.w localw;
    do
    {
      do
      {
        if (!localy.e()) {
          break;
        }
        localObject = (n)localy.j();
        localw = parama_.b(new a.d.w(((n)localObject).h(), 0.0D));
        if ((!bool3) && (bool2)) {
          break label140;
        }
        ((n)localObject).g(bool1 ? localw.b() : localw.a());
        localy.f();
      } while (!bool2);
    } while (bool3);
    localy = e().h();
    label140:
    do
    {
      if (!localy.e()) {
        break;
      }
      localObject = (pc)localy.j();
      localw = parama_.b(new a.d.w(0.0D, ((pc)localObject).h()));
      ((pc)localObject).g(bool1 ? localw.a() : localw.b());
      localy.f();
    } while (!bool2);
  }
  
  private a.d.w a(n paramn, boolean paramBoolean)
  {
    if (paramBoolean) {
      return new a.d.w(0.0D, paramn.h());
    }
    return new a.d.w(paramn.h(), 0.0D);
  }
  
  private a.d.w a(pc parampc, boolean paramBoolean)
  {
    if (paramBoolean) {
      return new a.d.w(parampc.h(), 0.0D);
    }
    return new a.d.w(0.0D, parampc.h());
  }
  
  private void a(q paramq, boolean paramBoolean)
  {
    boolean bool2 = d.R;
    boolean bool1 = d.Q;
    k localk = paramq.c(b);
    if (localk != null)
    {
      x localx = paramq.B();
      HashMap localHashMap = new HashMap();
      z localz = new z();
      int k = 0;
      Object localObject1 = paramq.v();
      Object localObject2;
      Object localObject3;
      Object localObject4;
      ld.b_ localb_;
      label214:
      label216:
      label238:
      label367:
      label369:
      do
      {
        do
        {
          if (!((a.c.w)localObject1).e()) {
            break;
          }
          localObject2 = ((a.c.w)localObject1).d();
          localObject3 = (jc)localk.get(localObject2);
          if (bool1) {
            break label759;
          }
          if (localObject3 != null) {
            if (paramBoolean)
            {
              localObject4 = ((jc)localObject3).c();
              if (!bool2) {
                if (!localHashMap.containsKey(localObject4))
                {
                  localz.add(localObject4);
                  localb_ = new ld.b_(0, !((pc)localObject4).j());
                  localx.a(localObject2, localb_);
                  localHashMap.put(localObject4, localb_);
                  if (bool2) {
                    break label216;
                  }
                  if (!bool1) {
                    break label214;
                  }
                }
              }
              localb_ = (ld.b_)localHashMap.get(localObject4);
              localx.a(localObject2, localb_);
              if (!bool2) {
                if (k == 0) {
                  if (bool2) {
                    break label238;
                  }
                }
              }
              k = !((pc)localObject4).j() ? 1 : 0;
              if (bool2) {
                continue;
              }
              if (!bool1) {}
            }
            else
            {
              localObject4 = ((jc)localObject3).d();
              if (!bool2) {
                if (!localHashMap.containsKey(localObject4))
                {
                  localz.add(localObject4);
                  localb_ = new ld.b_(0, !((n)localObject4).j());
                  localx.a(localObject2, localb_);
                  localHashMap.put(localObject4, localb_);
                  if (bool2) {
                    break label369;
                  }
                  if (!bool1) {
                    break label367;
                  }
                }
              }
              localb_ = (ld.b_)localHashMap.get(localObject4);
              localx.a(localObject2, localb_);
              if (!bool2) {
                if (k == 0) {
                  if (bool2) {
                    break label391;
                  }
                }
              }
              k = !((n)localObject4).j() ? 1 : 0;
            }
          }
          ((a.c.w)localObject1).f();
        } while (!bool1);
      } while (bool2);
      label391:
      if ((bool2) || (k != 0))
      {
        if (paramBoolean)
        {
          localObject1 = new Comparator()
          {
            public int compare(Object paramAnonymousObject1, Object paramAnonymousObject2)
            {
              boolean bool = d.R;
              pc localpc1 = (pc)paramAnonymousObject1;
              pc localpc2 = (pc)paramAnonymousObject2;
              if (!bool) {
                if (localpc1.j())
                {
                  if (!bool) {
                    if (localpc2.j()) {
                      return 0;
                    }
                  }
                  return 1;
                }
              }
              if (!bool) {
                if (localpc2.j()) {
                  return -1;
                }
              }
              return localpc1.compareTo(paramAnonymousObject2);
            }
          };
          localz.a((Comparator)localObject1);
        }
        else
        {
          localObject1 = new Comparator()
          {
            public int compare(Object paramAnonymousObject1, Object paramAnonymousObject2)
            {
              boolean bool = d.R;
              n localn1 = (n)paramAnonymousObject1;
              n localn2 = (n)paramAnonymousObject2;
              if (!bool) {
                if (localn1.j())
                {
                  if (!bool) {
                    if (localn2.j()) {
                      return 0;
                    }
                  }
                  return 1;
                }
              }
              if (!bool) {
                if (localn2.j()) {
                  return -1;
                }
              }
              return localn1.compareTo(paramAnonymousObject2);
            }
          };
          localz.a((Comparator)localObject1);
        }
        int m = 0;
        localObject2 = localz.h();
        do
        {
          if (!((y)localObject2).e()) {
            break;
          }
          localObject3 = (ld.b_)localHashMap.get(((y)localObject2).j());
          ((ld.b_)localObject3).a(m++);
          ((y)localObject2).f();
          if (bool2) {
            break label554;
          }
          if (bool1) {
            break label549;
          }
        } while (!bool1);
        if (!bool2)
        {
          ld.a(paramq, localx, 5, 2);
          label549:
          label554:
          int n = localz.size();
          if (paramBoolean)
          {
            localObject3 = e().h();
            do
            {
              if (!((y)localObject3).e()) {
                break;
              }
              localObject4 = (pc)((y)localObject3).j();
              localb_ = (ld.b_)localHashMap.get(localObject4);
              if (bool1) {
                return;
              }
              if (localb_ != null)
              {
                ((pc)localObject4).a(localb_.a());
                if (bool2) {
                  continue;
                }
                if (!bool1) {}
              }
              else
              {
                ((pc)localObject4).a(n++);
              }
              ((y)localObject3).f();
            } while (!bool1);
          }
          if (bool2) {
            return;
          }
          localObject3 = f().h();
          do
          {
            if (!((y)localObject3).e()) {
              break;
            }
            localObject4 = (n)((y)localObject3).j();
            localb_ = (ld.b_)localHashMap.get(localObject4);
            if (bool1) {
              return;
            }
            if (localb_ != null)
            {
              ((n)localObject4).a(localb_.a());
              if (bool2) {
                continue;
              }
              if (!bool1) {}
            }
            else
            {
              ((n)localObject4).a(n++);
            }
            ((y)localObject3).f();
          } while (!bool1);
        }
      }
      else
      {
        label759:
        if (bool2) {
          return;
        }
      }
      paramq.a(localx);
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.d.a.kc

 * JD-Core Version:    0.7.0.1

 */